Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ feat(notifications): open_period_start_for_group util for threads #83689

Merged
merged 2 commits into from
Jan 22, 2025

Conversation

iamrajjoshi
Copy link
Member

This PR introduces a function that returns the latest "open period" for a particular group. It will be used as a key in future threads refactor PR to create 1 thread per open group.

One example use case is to return the latest open period for an Uptime Issue.

spec: notion.so/sentry/Slack-Threads-Refactor-1618b10e4b5d807db67ae6d4d85247b9
contributes to: getsentry.atlassian.net/browse/ACI-89

@iamrajjoshi iamrajjoshi requested review from wedamija, snigdhas and a team January 17, 2025 23:48
@iamrajjoshi iamrajjoshi self-assigned this Jan 17, 2025
@iamrajjoshi iamrajjoshi requested a review from a team as a code owner January 17, 2025 23:48
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Jan 17, 2025
from sentry.models.group import Group


def open_period_start_for_group(group: Group) -> datetime | None:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

open to moving this somewhere else, i think we should have a single place where we store these types of utils to work with Open Periods for notifications/issue platform.

as we figure out what types of methods exist, we can start bringing them together, open to leaving this as a todo

@snigdhas
Copy link
Member

#83797 might have what you're looking for. Calling get_open_periods_for_group with limit=1 will get you the latest open period

@iamrajjoshi iamrajjoshi merged commit 520e100 into master Jan 22, 2025
49 checks passed
@iamrajjoshi iamrajjoshi deleted the raj/slack-ref/latest-open-period branch January 22, 2025 15:46
@github-actions github-actions bot locked and limited conversation to collaborators Feb 7, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Scope: Backend Automatically applied to PRs that change backend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants